Skip to main content

Customs Declaration

Customs declaration API auto-sends the WeChat/Alipay payment data to the customs to simplify the clearance process and saves time for online cross-border stores.

Push Customs Declaration

HTTP Request

Endpoint : /custom/v1/declare

Method : POST

Request Parameters

AttributeMandatoryTypeDescription
trade_typeYesString(8)weixin or alipay
syssnYesString(32)QFPay transaction number
customsYesString(20)Customs for declaration. Example:SHANGHAI_ZS
mch_customs_noYesString(20)Customs registration No. of the merchant
action_typeNoString(256)Declaration type. Only valid when trate_type is "wechat". "ADD" - new appplication, "MODIFY" - modification of applied declaration
mch_customs_nameNoString(256)Merchant customs record name. Must be passed when trate_type is "alipay". Exaple: jwyhanguo_card
out_request_noNoString(32)Merchant order number. Must be passed when trate_type is "alipay". Exaple: 15725904083420588032
amountNoString(20)Declaration amount. Must be passed when trate_type is "alipay". Example: 2.00

The following fields should be passed in case splitting or modifying order

AttributeMandatoryTypeDescription
sub_order_noCString(64)Merchant sub-order No. It is required if there is a split order. Example:1111960490
fee_typeCString(8)Currency. Must be passed when trate_type is "wechat". It can only be CNY
order_feeCString(8)Sub-order amount (in 0.01 CNY). Cannot exceed the original order amount. order_fee=transport_fee+product_fee. It is required if there is a split order Example:888
product_feeCString(8)Product price (in 0.01 CNY). It is required if there is a split order. Example:888
transport_feeCString(8)Logistics fee (in 0.01 CNY). It is required if there is a split order. Example:888

Response Parameters

AttributeTypeDescription
syssnString(40)QFPay transaction number
respcdString(4)0000 = Declaration successful.
1143/1145 = merchants are required to continue to query the declaration result.
All other return codes indicate transaction failure. Please refer to the page Transaction Status Codes for a complete list of response codes.
resperrString(128)Response message
respmsgString(128)Other message information
verify_departmentVerification organization
verify_department_trade_idTransaction number of verification organization

Query Customs Declaration

Merchants query declaration status by QFPay transaction number.

HTTP Request

Endpoint : /custom/v1/query

Method : POST / GET

Request Parameters

AttributeMandatoryTypeDescription
trade_typeYesString(8)weixin or alipay
customsYesString(20)Customs for declaration. Example:SHANGHAI_ZS
syssnYesString(32)QFPay transaction number
sub_order_noNoString(40)Sub order number. It is required if there is a split order.

Response Parameters

AttributeTypeDescription
syssnString(40)QFPay transaction number
respcdString(4)0000 = Declaration successful.
1143/1145 = merchants are required to continue to query the declaration result.
All other return codes indicate transaction failure. Please refer to the page Transaction Status Codes for a complete list of response codes.
resperrString(128)Response message
respmsgString(128)Other message information
dataCustoms declaration details [{"resperr" : "", "errmsg" : null, "sub_order_no" : "15752730835729139712", "verify_department" : "OTHERS", "verify_department_trade_id" : "4200000459201911265585026208"}]

Repush Customs Declaration

If additional order information has been submitted to the customs but is lost in the electronic port, the customs declaration re-push API can be used to push the information to the customs again.

HTTP Request

Endpoint : /custom/v1/redeclare

Method : POST

Request Parameters

AttributeMandatoryTypeDescription
trade_typeYesString(8)weixin or alipay
customsYesString(20)Customs for declaration. Example:SHANGHAI_ZS
syssnYesString(32)QFPay transaction number
mch_customs_noYesString(20)Customs registration No. of the merchant. Example: 110084111
sub_order_noNoString(40)Sub order number. It is required if there is a split order.

Response Parameters

AttributeTypeDescription
syssnString(40)QFPay transaction number
respcdString(4)0000 = Declaration successful.
1143/1145 = merchants are required to continue to query the declaration result.
All other return codes indicate transaction failure. Please refer to the page Transaction Status Codes for a complete list of response codes.
resperrString(128)Response message
respmsgString(128)Other message information